package edu.drexel.cs575.taskManager.services.notification;

import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import twitter4j.TwitterException;

import javax.jws.WebService;



@WebService

public class notification_caller {

	public boolean createNotification (String Appname, String Name, String Email, String Txt, String Social)
	{
		notification_api call=new notification_api();
		return call.createNotification(Appname, Name, Email, Txt, Social);
	
	}
	
	public boolean removeNotification (String Name, String Appname)
	{
		notification_api call=new notification_api();
		return call.removeNotification(Name, Appname);
	}
	
	
	public boolean addNotificationPreference (String Username, String AppName, String Event_id, boolean Event_Pref){
		notification_api call=new notification_api();
		return call.addNotificationPreference(Username, AppName, Event_id, Event_Pref);
	}

	public String getEmail (String Name, String Appname){
		notification_api call=new notification_api();
		return call.getEmail(Name, Appname);
	}
	
	
	public String getTxt (String Name, String Appname)	{
		notification_api call=new notification_api();
		return call.getTxt(Name, Appname);
	}
	
	
	public String getSocial (String Name, String Appname){
		notification_api call=new notification_api();
		return call.getSocial(Name, Appname);
	}
	
	public String getNotificationPref (String Name, String AppName, String Event_id){
		notification_api call=new notification_api();
		return call.getNotificationPref(Name, AppName, Event_id);
	}
	
	
	public boolean removeNotifcationPreference (String Username, String AppName, String Event_id ){
		notification_api call=new notification_api();
		return call.removeNotifcationPreference(Username, AppName, Event_id);
	}
	
	public void sendEmail(String email, String content, String Subject){
		notification_api call=new notification_api();
		try {
			call.sendEmail(email, content, Subject);
		} catch (AddressException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MessagingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
	
	
	public void sendTxt(String phone, String carrier, String content){
		notification_api call=new notification_api();
		try {
			call.sendTxt(phone, carrier, content);
		} catch (AddressException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MessagingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
	

	
	public void sendTweet(String useracct,String comment){
		notification_api call=new notification_api();
		try {
			call.sendTweet(useracct, comment);
		} catch (TwitterException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	
	
}
